package cn.sightsnow.zh.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;

import javax.validation.constraints.NotNull;
import java.util.Date;
@ApiModel(description = "定位信息")
@Data
public class Location {

    @ApiModelProperty("定位点ID")
    @Id
    private String locationId;

    @ApiModelProperty("设备ID")
    @Indexed
    @NotNull
    private String targetId;

    @ApiModelProperty("线路ID")
    @Indexed
    @NotNull
    private String routeId;

    @ApiModelProperty("纬度")
    @NotNull
    private Double lng;
    @ApiModelProperty("经度")
    @NotNull
    private Double lat;

    @ApiModelProperty("速度")
    private Double speed;
    @ApiModelProperty("定位发送时间")
    private Date date;

    private void setDate() {
    }

    Location() {
        date = new Date();
    }
}
